const path = require('path')
const resolve = dir => {
  return path.join(__dirname, dir)
}
const HOST_ADDRESS = "host.docker.internal";
// const HOST_ADDRESS = "192.168.20.7";
module.exports = {
  publicPath: './',
  chainWebpack: config => {
    config.resolve.alias
      .set('_c', resolve('src/components'))
  },
  devServer: {
    host: "0.0.0.0",
    port: 8080,
    public: HOST_ADDRESS + ":8080",
    proxy: {
      "/api":{
        target: 'http://' + HOST_ADDRESS + ':8000',
        ws: true,
        changeOrigin: true,  // 是否改变原始主机头为目标 URL
      }
    },
    https: false,
    disableHostCheck: true,
    open: false
  }
}